home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / editor / blksedtr.lha / BED / Rexx / SASC / ErrorStep.bed < prev    next >
Text File  |  1996-05-06  |  2KB  |  137 lines

  1. /*
  2. ** $VER: ErrorStep.bed 1.0 (14.01.96)
  3. **
  4. ** Move the cursor to the lines of errors occurred during compilation
  5. ** with SAS C.
  6. */
  7.  
  8. ARG direction
  9.  
  10. port = ADDRESS()
  11. Address 'SC_SCMSG'
  12.  
  13. INTERPRET direction
  14.  
  15. OPTIONS RESULTS
  16.  
  17. 'File'
  18. main.file = RESULT
  19.  
  20. IF file = "" THEN DO
  21.     ADDRESS
  22.     SetStatusBar "No SAS/C Errors"
  23.     EXIT 0
  24. END
  25.  
  26. 'AltFile'
  27. alt.file = RESULT
  28.  
  29. 'Number'
  30. err.num = RESULT
  31.  
  32. 'Text'
  33. err.text = RESULT
  34.  
  35. Call MainFile port
  36.  
  37. IF alt.file ~= "" THEN CALL AltFile port
  38.  
  39. EXIT 0
  40.  
  41.  
  42. /*-------------------------------------------------------------------*/
  43.  
  44. MainFile:
  45. PARSE ARG port
  46.  
  47. Address 'SC_SCMSG'
  48. 'Line'
  49. main.line = RESULT
  50.  
  51. CALL FindFileName main.file
  52. main.name = RESULT
  53.  
  54. CALL FindFilePort main.name,main.file,port
  55. main.port = RESULT
  56.  
  57. IF main.port = "" THEN RETURN
  58.  
  59. ADDRESS VALUE main.port
  60.  
  61. Move main.line 0
  62. ActivateWindow
  63. Window2Front
  64. SetStatusBar err.num||': '||err.text
  65.  
  66. RETURN
  67.  
  68. /*-------------------------------------------------------------------*/
  69.  
  70. AltFile:
  71. PARSE ARG port
  72.  
  73. Address 'SC_SCMSG'
  74. 'AltLine'
  75. alt.line = RESULT
  76.  
  77. CALL FindFileName alt.file
  78. alt.name = RESULT
  79.  
  80. CALL FindFilePort alt.name,alt.file,port
  81. alt.port = RESULT
  82.  
  83. IF alt.port = "" THEN RETURN
  84.  
  85. ADDRESS VALUE alt.port
  86. Move alt.line 0
  87. ActivateWindow
  88. Window2Front
  89. SetStatusBar err.num||': '||err.text
  90.  
  91. RETURN
  92.  
  93.  
  94. /*-------------------------------------------------------------------*/
  95.  
  96. /*
  97. ** FindFileName -- Extracts the filename part of a path specification.
  98. */
  99.  
  100. FindFileName: PROCEDURE
  101. parse arg path
  102.  
  103. dirend = LastPos('/', path)
  104. if dirend = 0
  105.     then dirend = Pos(':', path)
  106. if dirend ~= 0
  107.     then name = SubStr(path, dirend+1)
  108.     else name = path
  109.  
  110. return name
  111.  
  112. /*-------------------------------------------------------------------*/
  113.  
  114. /*
  115. **  FindFilePort -- Finds the TurboText port corresponding to a file, or
  116. ** tries to open the file if it is not in memory.
  117. */
  118.  
  119. FindFilePort: PROCEDURE
  120. parse arg file,path,port
  121.  
  122. Address BED GetPort file
  123.  
  124. if RESULT = "RESULT"
  125.     then do
  126.         Address VALUE port
  127.         promptstr = '"Load ' || file || '?"'
  128.         RequestBool '"TTX <=> SAS/C"' promptstr
  129.         if RESULT = "YES"
  130.         then do
  131.             OpenDoc NAME path
  132.             Return RESULT
  133.         end
  134.         else Return ""
  135. end
  136. else Return RESULT
  137.